<?php
	$url="https://api.weixin.qq.com/cgi-bin/menu/create?access_token=VwFHV70RhD7p8dszerWNxvj_VdSrl2KWWPhHxLQOUxYauHMcs-EhzBtk9cVURJK6iF_tNz_IU-0L2Z9QmROngX8l15fhBH86zo8IfVlsila2uEALk0tXfehJNt08owhyYFVhAAAHOE";
	//初始化
	$ch=curl_init();
	// 设置参数
	curl_setopt($ch,CURLOPT_URL,$url);
	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch,CURLOPT_HEADER,0);
	//禁止SSL校验操作
	curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
	curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
	$data='{
		     "button":[
		      {
		            "name":"借阅伴侣",
		        	"sub_button":[
		        	{
						"type":"scancode_push",
		          		"name":"扫一扫",
		          		"key": "rselfmenu_0_1", 
                    	"sub_button": [ ]
					},
		        	{
						"type":"view",
		          		"name":"图书馆",
		          		"url":"http://niceweekend.cc/jieyue"
					},
					{
						"type":"view",
		          		"name":"借书码",
		          		"url":"http://niceweekend.cc/jieyue/Home/Jiehuanshu/jieshuma"
					},
					{
						"type":"view",
		          		"name":"还书码",
		          		"url":"http://niceweekend.cc/jieyue/Home/Jiehuanshu/huanshuma"
					},
					{
						"type":"view",
		          		"name":"搜索图书",
		          		"url":"http://niceweekend.cc/jieyue/Home/Shouye/ssjieguo"
					}]
				
					
		          
		      },
		      {
		        "name":"借阅导航",
		        "sub_button":[
					{
						 "type":"click",
		                 "name":"借书说明",
		                 "key":"V1001_GOOD"
					},
					{
						"type":"click",
		                 "name":"借书流程",
		                 "key":"V1002_WOOD"
					},
					{
						"type":"click",
		                 "name":"还书流程",
		                 "key":"V1003_VOOD"
					}
				]
				
		          
		      },
		      {
		        "name":"关于我们",
		        "sub_button":[
					{
						"type":"view",
		          		"name":"管理员",
		          		"url":"http://niceweekend.cc/jieyue/index.php/Home/Adminlogin/login"
					},
					{
						 "type":"view",
		                 "name":"联系我们",
		                 "url":"http://mp.weixin.qq.com/s/AyEGov9beZ-Yz0mgUhI_LQ"
					}
				]
				
		          
		      }]
		    
		 }';
	curl_setopt($ch,CURLOPT_POST,1);
	curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
	//执行curl
	$output=curl_exec($ch);
	// if($output===false){
	// 	echo 'error:'.curl_error($ch);
	// }
	//关闭句柄
	curl_close($ch);

	echo $output;

// e12fe6633687dd24fa935b8f67d9057d

?>